<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>模拟器监控管理 </title>
<@fm.header />
<script type="text/javascript" src="/resources/js/common.js"></script>
<script type="text/javascript" src="/resources/js/qyChannelSimulatorListen/qyChannelSimulatorListen.js"></script>
</head>
<body class="cmp-list-body">
<div id="tb" style="padding:3px">
    <span>机柜</span>
	<input id="slocationId" class="easyui-textbox" style="width: 155px;" name="location"/>
	<span>IP</span>
	<input id="sclientIpId" class="easyui-textbox" style="width: 155px;" name="clientIp"/>
	<span>mac</span>
	<input id="sclientMacId" class="easyui-textbox" style="width: 155px;" name="clientMac"/>
	<span>设备号</span>
	<input id="suuidId" class="easyui-textbox" style="width: 155px;" name="uuid"/>
	<span>母包版本</span>
	<input id="sversionId" class="easyui-textbox" style="width: 155px;"/>
	<span>系统版本</span>
	<input id="osVersion" class="easyui-textbox" style="width: 155px;"/>
	<span>心跳包版本</span>
	<input id="sheartVersionId" class="easyui-textbox" style="width: 155px;"/>
	<span>任务状态:</span>
	<select class="easyui-combobox" id="sactionTypeId" panelHeight="auto" style="width:155px" >
	        <option value="" selected>全部</option>
            <option value="1">在空闲</option>
        	<option value="2">正在执行任务</option>
        	<option value="3">任务已完成</option>
        	<option value="4">等待执行任务</option>
    </select>
	<span>在线状态:</span>
	<select class="easyui-combobox" id="isOnlineId" panelHeight="auto" style="width:155px" >
	        <option value="" selected>全部</option>
            <option value="0">在线</option>
        	<option value="1">离线</option>
    </select>
    <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch();">查询</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradePack();">升级母包</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradeSystem();">升级系统</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradeHeart();">升级心跳包</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="closePhone();">关闭手机</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="restartPhone();">重启手机</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="stopMark();">暂停做mark任务</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="restartMark();">重启做mark任务</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="viewTask();">查看任务</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="clearLocation();">机柜重新分配</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="clearSimulator();">清理离线模拟器</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="clearSimulatorOld();">清理离线模拟器(老)</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="searchSimulator();">查找模拟器</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="setNum();">设置一键升级量</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="batchUpgradeSystem();">一键升级</a>
    <!-- <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="unSearchSimulator();">关闭查找模拟器</a>-->
</div>

<table id="tt" title="模拟器监控管理" 
	 toolbar="#tb" rownumbers="true" idField="uuid" singleSelect="false" pagination="true" 
	    fitColumns="true" selectOnCheck="true" data-options="onLoadSuccess:dataOnLoadSuccess" pageSize="100" pageList="[100,200,400,800,1600]">  
    <thead>
        <tr>
            <th data-options="field:'ck',checkbox:true"></th>
            <th align="center" width="10%" field="location">机柜</th>
		    <th align="center" width="15%" field="clientIp">客户端IP</th>
		    <th align="center" width="15%" field="clientMac">客户端MAC</th>
		    <th align="center" width="10%" field="version">母包版本</th>
		    <th align="center" width="10%" field="osVersion">系统版本</th>
		    <th align="center" width="10%" field="heartVersion">心跳包版本</th>
		    <th align="center" width="10%" field="online" formatter="onLineFormatter">在线状态</th>
		    <th align="center" width="10%" field="actionType" formatter="actionTypeFormatter" >任务状态</th>
		    <th align="center" width="10%" field="status" formatter="statusFormatter">模拟器状态</th>
		    <th align="center" width="10%" field="currentTime">更新时间</th>
		    <th align="center" width="10%" field="uuid">设备号</th>
        </tr>
    </thead>   
</table>

<div id="upgradeWin" class="easyui-window" title="模拟器监控管理|升级母包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeForm"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="fromVersion" id="fromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="toVersion" id="toVersionId" readonly="true" />
	                   </td>
	               </tr>
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton" onclick="upgradeCancel();">取消</a>
               <a href="#" class="easyui-linkbutton"  onclick="upgradesubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="apkUrl" id="apkUrlId" />
             <input class="easyui-textbox" type="hidden" name="filePath" id="filePathId" />
             <input class="easyui-textbox" type="hidden" name="mark" id="markId" />
             <table class="easyui-datagrid" id="upgradett"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:versionDbClick,onLoadSuccess:versionOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>

<div id="upgradeSystemWin" class="easyui-window" title="模拟器监控管理|升级母包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeSystem"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="systemFromVersion" id="systemfromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="systemToVersion" id="systemToVersionId" readonly="true" />
	                   </td>
	               </tr>
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton" onclick="upgradeSystemCancel();">取消</a>
               <a href="#" class="easyui-linkbutton"  onclick="upgradeSystemSubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="apkUrl" id="systemApkUrlId" />
             <input class="easyui-textbox" type="hidden" name="filePath" id="systemFilePathId" />
             <input class="easyui-textbox" type="hidden" name="mark" id="systemMarkId" />
             <table class="easyui-datagrid" id="upgradeSystemDg"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:systemDbClick,onLoadSuccess:versionOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>

<div id="batchUpgradeSystemWin" class="easyui-window" title="模拟器监控管理|升级母包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="batchUpgradeSystem"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="batchSystemFromVersion" id="batchSystemFromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="batchSystemToVersion" id="batchSystemToVersionId" readonly="true" />
	                   </td>
	               </tr>
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton" onclick="batchUpgradeSystemCancel();">取消</a>
               <a href="#" class="easyui-linkbutton"  onclick="batchUpgradeSystemSubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="apkUrl" id="batchSystemApkUrlId" />
             <input class="easyui-textbox" type="hidden" name="filePath" id="batchSystemFilePathId" />
             <input class="easyui-textbox" type="hidden" name="mark" id="batchSystemMarkId" />
             <table class="easyui-datagrid" id="batchUpgradeSystemDg"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:batchSystemDbClick,onLoadSuccess:versionOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>


<div id="upgradeHeartWin" class="easyui-window" title="模拟器监控管理|升级心跳包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeHeartForm"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="heartfromVersion" id="heartfromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="hearttoVersion" id="hearttoVersionId" readonly="true" />
	                   </td>
	               </tr>
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton" onclick="upgradeHeartCancel();">取消</a>
               <a href="#" class="easyui-linkbutton"  onclick="upgradeHeartsubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="filePath" id="heartfilePathId" />
             <input class="easyui-textbox" type="hidden" name="heartMd5" id="heartmd5Id" />
             <input class="easyui-textbox" type="hidden" name="bucketName" id="heartbucketNameId" />
             <table class="easyui-datagrid" id="upgradehearttt"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:heartDbClick,onLoadSuccess:heartOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="modifyTime">修改时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>


<div id="viewTaskWin" class="easyui-window" title="模拟器监控管理|内容查看" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:300px;height:350px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <form id="upgradeForm"  method="post">
	         <table>
	               <tr>
	                   <td align="left">任务类型</td>
	                   <td>
		                   <select class="easyui-combobox" id="taskTypeId" panelHeight="auto" style="width:200px" >
		                       <option value="1">手机重启</option>
	                           <option value="2">手机关机</option>
	        	               <option value="3">升级母包</option>
	        	               <option value="4">暂停做mark任务</option>
	        	               <option value="5">重启做mark任务</option>
	        	               <option value="6">升级心跳包</option>
	        	               <option value="7">找手机</option>
	        	               <option value="8">系统OTA升级</option>
	                       </select>
	                   </td>
	               </tr>
	               <tr>
	                   <td align="left">任务类型</td>
	                   <td>
		                   <textarea name="taskContent" id="taskContentId" readonly="true" data-options="multiline:true" style="width:200px;height:100px" ></textarea>
	                   </td>
	               </tr>
	           </table>
         </form>
    </div>
</div>

<div id="setNumWin" class="easyui-window" title="模拟器监控管理|设置一键升级量" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:300px;height:200px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <form id="setNumFrom" method="post">
	         <table>
	               <tr>
	               	<td><span>每次下发量:</span></td>
	                <td>   
        				<input type="text" class="easyui-textbox" name="upgradeSystemNum" id="upgradeSystemNum"> </input>
        			</td>
	               </tr>
	               <tr>
	               	<td><span>间隔下发时间(分钟):</span></td>
	                <td>   
        				<input type="text" class="easyui-textbox" name="upgradeSystemIntervalTime" id="upgradeSystemIntervalTime"> </input>
        			</td>
	               </tr>
	           </table>
         </form>
         <div style="padding: 25px; text-align: center;">
       		<a href="#" class="easyui-linkbutton" onclick="setNumCancel();">取消</a>
       		<a href="#" class="easyui-linkbutton"  onclick="setNumSubmit();">保存</a> 
    	 </div>
    </div>
</div>

</body>
</html>